/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ejb;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.netbeans.saas.google.*;
import org.netbeans.saas.*;

/**
 *
 * @author ciro
 */
@Stateless
public class MovieFacade extends AbstractFacade<Movie> {

    @PersistenceContext(unitName = "Movie-ejbPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public MovieFacade() {
        super(Movie.class);
    }
    
    public String getGoogleMap(String address, Integer zoom, String iframe) {    
        try {
            //String address = "16 Network Circle, Menlo Park";
            //java.lang.Integer zoom = 15;
            //String iframe = "false";
            RestResponse result = GoogleMapService.getGoogleMap(address, zoom, iframe);
            return result.getDataAsString();
        }

        catch (Exception ex) {
            ex.printStackTrace();
        }
        return null;
    }
}
